package InterfazGrafica;

import java.awt.Desktop;
import java.awt.Desktop.*;
import java.net.URI;

public class PantallaAcercaDe extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    public PantallaAcercaDe(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        GoogleCode = new javax.swing.JButton();
        LogoCEU = new javax.swing.JButton();
        Label_Proyecto = new javax.swing.JLabel();
        Label_WebCEU = new javax.swing.JLabel();
        Label_Autor = new javax.swing.JLabel();
        Label_Escuela = new javax.swing.JLabel();
        Label_Curso = new javax.swing.JLabel();
        Label_AñoAcademico = new javax.swing.JLabel();
        Label_WebProyecto = new javax.swing.JLabel();
        Label_Asignatura = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Acerca de...");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setIconImage(null);
        setLocationByPlatform(true);
        setMinimumSize(new java.awt.Dimension(800, 600));
        setResizable(false);

        GoogleCode.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/GoogleApps.jpg"))); // NOI18N
        GoogleCode.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GoogleCodeActionPerformed(evt);
            }
        });

        LogoCEU.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logoCEUPequeño.jpg"))); // NOI18N
        LogoCEU.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LogoCEUActionPerformed(evt);
            }
        });

        Label_Proyecto.setFont(new java.awt.Font("Arial", 1, 12));
        Label_Proyecto.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_Proyecto.setText("Proyecto Creado por:");

        Label_WebCEU.setFont(new java.awt.Font("Arial", 3, 14));
        Label_WebCEU.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_WebCEU.setText("Página Web de la Universidad CEU San Pablo"); // NOI18N

        Label_Autor.setFont(new java.awt.Font("Arial", 3, 14));
        Label_Autor.setForeground(new java.awt.Color(0, 0, 204));
        Label_Autor.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_Autor.setText("Manuel Conde Gago");

        Label_Escuela.setFont(new java.awt.Font("Arial", 2, 12));
        Label_Escuela.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_Escuela.setText("Escuela Politécnica Superior (Campus de Montepríncipe)"); // NOI18N

        Label_Curso.setFont(new java.awt.Font("Arial", 2, 12));
        Label_Curso.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_Curso.setText("2º Ingeniería Superior de Informática"); // NOI18N

        Label_AñoAcademico.setFont(new java.awt.Font("Arial", 2, 12));
        Label_AñoAcademico.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_AñoAcademico.setText("Curso 2010-2011"); // NOI18N

        Label_WebProyecto.setFont(new java.awt.Font("Arial", 3, 14));
        Label_WebProyecto.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_WebProyecto.setText("Página Web donde se aloja el Proyecto"); // NOI18N

        Label_Asignatura.setFont(new java.awt.Font("Arial", 2, 12));
        Label_Asignatura.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Label_Asignatura.setText("Metodología y Tecnología de la Programación II"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Label_Proyecto, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
                    .addComponent(Label_Escuela, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
                    .addComponent(Label_Curso, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
                    .addComponent(Label_Autor, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(LogoCEU, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(Label_WebCEU, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(GoogleCode, javax.swing.GroupLayout.PREFERRED_SIZE, 379, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE))
                            .addComponent(Label_WebProyecto, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE)))
                    .addComponent(Label_Asignatura, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE)
                    .addComponent(Label_AñoAcademico, javax.swing.GroupLayout.DEFAULT_SIZE, 790, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(GoogleCode, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(LogoCEU, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Label_WebCEU, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Label_WebProyecto, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(Label_Proyecto, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label_Autor, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addComponent(Label_Curso, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label_Escuela, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label_Asignatura, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(7, 7, 7)
                .addComponent(Label_AñoAcademico, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        getAccessibleContext().setAccessibleName("Acerca de...");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void LogoCEUActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LogoCEUActionPerformed
        irAUnaPaginaWebAlPresionarElBoton("http://www.uspceu.com");
    }//GEN-LAST:event_LogoCEUActionPerformed

    private void GoogleCodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GoogleCodeActionPerformed
        irAUnaPaginaWebAlPresionarElBoton("http://code.google.com/p/minipaint-mconde/");
    }//GEN-LAST:event_GoogleCodeActionPerformed

    private void irAUnaPaginaWebAlPresionarElBoton(String URL) {
        try {
            Desktop.getDesktop().browse(new URI(URL));
        } catch (Exception noSeHaPodidoAbrirLaWebOElNavegador) {
            System.out.println(noSeHaPodidoAbrirLaWebOElNavegador);
        }
    }

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                PantallaAcercaDe dialog = new PantallaAcercaDe(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton GoogleCode;
    private javax.swing.JLabel Label_Asignatura;
    private javax.swing.JLabel Label_Autor;
    private javax.swing.JLabel Label_AñoAcademico;
    private javax.swing.JLabel Label_Curso;
    private javax.swing.JLabel Label_Escuela;
    private javax.swing.JLabel Label_Proyecto;
    private javax.swing.JLabel Label_WebCEU;
    private javax.swing.JLabel Label_WebProyecto;
    private javax.swing.JButton LogoCEU;
    // End of variables declaration//GEN-END:variables
}
